﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.CustomerOrder
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("customer_order", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class customer_order : Entity<customer_order>,Icustomer_order
    {
        #region 属性
 
        private String _order_no;

        /// <summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("订单号")]
        [Description("FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(1, "order_no",  null, "varchar(20)", 0, 0, false)]

        public virtual String order_no

        {
            get { return _order_no; }
            set { if (OnPropertyChanging(__.order_no, value)) { _order_no = value; OnPropertyChanged(__.order_no); } }
        }

 
        private String _company;

        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=公司^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("公司")]
        [Description("FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=公司^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(2, "company",  null, "varchar(10)", 0, 0, false)]

        public virtual String company

        {
            get { return _company; }
            set { if (OnPropertyChanging(__.company, value)) { _company = value; OnPropertyChanged(__.company); } }
        }

 
        private String _customer_no;

        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=客户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("客户")]
        [Description("FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=客户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(3, "customer_no",  null, "varchar(20)", 0, 0, false)]

        public virtual String customer_no

        {
            get { return _customer_no; }
            set { if (OnPropertyChanging(__.customer_no, value)) { _customer_no = value; OnPropertyChanged(__.customer_no); } }
        }

 
        private String _person_id;

        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=用户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("用户")]
        [Description("FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=用户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(4, "person_id",  null, "varchar(20)", 0, 0, false)]

        public virtual String person_id

        {
            get { return _person_id; }
            set { if (OnPropertyChanging(__.person_id, value)) { _person_id = value; OnPropertyChanged(__.person_id); } }
        }

 
        private String _region_code;

        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=区域^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("区域")]
        [Description("FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=区域^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(5, "region_code",  null, "varchar(10)", 0, 0, false)]

        public virtual String region_code

        {
            get { return _region_code; }
            set { if (OnPropertyChanging(__.region_code, value)) { _region_code = value; OnPropertyChanged(__.region_code); } }
        }

 
        private String _address;

        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=地址^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("地址")]
        [Description("FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=地址^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn(6, "address",  null, "varchar(2000)", 0, 0, false)]

        public virtual String address

        {
            get { return _address; }
            set { if (OnPropertyChanging(__.address, value)) { _address = value; OnPropertyChanged(__.address); } }
        }

 
        private DateTime? _delivery_date;

        /// <summary>FLAGS=A-IUL^FORMAT=Datetime^DATATYPE=Date^PROMPT=发货时间^LENGTH=0^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("发货时间")]
        [Description("FLAGS=A-IUL^FORMAT=Datetime^DATATYPE=Date^PROMPT=发货时间^LENGTH=0^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn(7, "delivery_date",  null, "datetime", 0, 0, false)]

        public virtual DateTime? delivery_date

        {
            get { return _delivery_date; }
            set { if (OnPropertyChanging(__.delivery_date, value)) { _delivery_date = value; OnPropertyChanged(__.delivery_date); } }
        }

 
        private String _note_text;

        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("备注")]
        [Description("FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn(8, "note_text",  null, "varchar(2000)", 0, 0, false)]

        public virtual String note_text

        {
            get { return _note_text; }
            set { if (OnPropertyChanging(__.note_text, value)) { _note_text = value; OnPropertyChanged(__.note_text); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(9, "objid",  null, "varchar(50)", 0, 0, false)]

        public virtual String objid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }

 
        private String _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(10, "objversion",  null, "varchar(24)", 0, 0, false)]

        public virtual String objversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.order_no : return _order_no;
                    case __.company : return _company;
                    case __.customer_no : return _customer_no;
                    case __.person_id : return _person_id;
                    case __.region_code : return _region_code;
                    case __.address : return _address;
                    case __.delivery_date : return _delivery_date;
                    case __.note_text : return _note_text;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.order_no : 
                        if(value != null)
                            _order_no = Convert.ToString(value);
                        else
                            _order_no = null;
                    break;
                    case __.company : 
                        if(value != null)
                            _company = Convert.ToString(value);
                        else
                            _company = null;
                    break;
                    case __.customer_no : 
                        if(value != null)
                            _customer_no = Convert.ToString(value);
                        else
                            _customer_no = null;
                    break;
                    case __.person_id : 
                        if(value != null)
                            _person_id = Convert.ToString(value);
                        else
                            _person_id = null;
                    break;
                    case __.region_code : 
                        if(value != null)
                            _region_code = Convert.ToString(value);
                        else
                            _region_code = null;
                    break;
                    case __.address : 
                        if(value != null)
                            _address = Convert.ToString(value);
                        else
                            _address = null;
                    break;
                    case __.delivery_date : 
                        if(value != null)
                            _delivery_date = Convert.ToDateTime(value);
                        else
                            _delivery_date = null;
                    break;
                    case __.note_text : 
                        if(value != null)
                            _note_text = Convert.ToString(value);
                        else
                            _note_text = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToString(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field order_no = FindByName(__.order_no);

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=公司^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field company = FindByName(__.company);

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=客户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field customer_no = FindByName(__.customer_no);

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=用户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field person_id = FindByName(__.person_id);

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=区域^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field region_code = FindByName(__.region_code);

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=地址^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field address = FindByName(__.address);

            ///<summary>FLAGS=A-IUL^FORMAT=Datetime^DATATYPE=Date^PROMPT=发货时间^LENGTH=0^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field delivery_date = FindByName(__.delivery_date);

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field note_text = FindByName(__.note_text);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String order_no = "order_no";

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=公司^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String company = "company";

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=客户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String customer_no = "customer_no";

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=用户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String person_id = "person_id";

            ///<summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=区域^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String region_code = "region_code";

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=地址^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String address = "address";

            ///<summary>FLAGS=A-IUL^FORMAT=Datetime^DATATYPE=Date^PROMPT=发货时间^LENGTH=0^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String delivery_date = "delivery_date";

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String note_text = "note_text";

            ///<summary></summary>
            public const String objid = "objid";

            ///<summary></summary>
            public const String objversion = "objversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Icustomer_order
    {
       #region 属性
        /// <summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String order_no { get; set; }


        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=公司^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String company { get; set; }


        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=客户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String customer_no { get; set; }


        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=用户^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String person_id { get; set; }


        /// <summary>FLAGS=AMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=区域^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String region_code { get; set; }


        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=地址^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String address { get; set; }


        /// <summary>FLAGS=A-IUL^FORMAT=Datetime^DATATYPE=Date^PROMPT=发货时间^LENGTH=0^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        DateTime? delivery_date { get; set; }


        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String note_text { get; set; }


        /// <summary></summary>

        String objid { get; set; }


        /// <summary></summary>

        String objversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}